package com.jinhua.huaojcodesandbox.security;

import java.security.Permission;

public class DefaultSecurityManager extends SecurityManager {
    @Override
    public void checkPermission(Permission perm) {
//        throw new SecurityException("权限不足" + perm.getActions());
//        super.checkPermission(perm);
    }

    @Override
    public void checkExec(String cmd) {
        throw new SecurityException("禁止行为" + cmd);
//        super.checkExec(cmd);
    }

    @Override
    public void checkRead(String file) {
//        throw new SecurityException("禁止行为:" + file);

        super.checkRead(file);
    }

    @Override
    public void checkWrite(String file) {
//        super.checkWrite(file);

        throw new SecurityException("禁止行为:" + file);


    }

    @Override
    public void checkDelete(String file) {
//        super.checkDelete(file);
        throw new SecurityException("禁止行为" + file);

    }

    @Override
    public void checkConnect(String host, int port) {
//        super.checkConnect(host, port);
        throw new SecurityException("禁止行为" + host + port);

    }
}
